﻿using System;
using System.Collections.Generic;
using System.Text;
using System.Drawing;
using ESRI.ArcGIS.esriSystem;
using ESRI.ArcGIS.Display;
using ESRI.ArcGIS.Carto;

namespace BTGISWASECO.Display
{
    public static class ColorManager
    {
        /// A utility class for color conversion operations
        /// 
        static Random rand;

        public static IColor GetESRIColorFromRGB(int red, int green, int blue)
        {
            IRgbColor color = new RgbColorClass();
            color.Red = red;
            color.Green = green;
            color.Blue = blue;
            return color;
        }

        public static IColor GetESRIColor(System.Drawing.Color color)
        {
            IColor esriColor = GetESRIColorFromRGB(color.R, color.G, color.B);
            return esriColor;
        }

        public static IColor GetESRIRandomColor()
        {
            if (rand == null)
                rand = new Random();

            IRgbColor color = new RgbColorClass();

           
            color.Red = rand.Next(255);
            color.Green = rand.Next(255);
            color.Blue = rand.Next(255);
            return color;
        }

        
    }
}
